<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>移动端隐藏滚动条解决方案</title>
    <style type="text/css">
    * {
        padding: 0;
        margin: 0;
    }

    .container {
        height: 50px;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
        overflow: hidden;
    }

.nav {
        /*width: 100%;*/
        height: 100%;
        overflow-x: scroll;
        overflow-y: scroll;
        background-color: #999;
        /*解决ios上滑动不流畅*/
        -webkit-overflow-scrolling: touch;
        /*纵向超出部分将会隐藏，即滚动条部分被挤出可视区域*/
        padding-bottom: 20px;
    }

    .con {
        width: 640px;
        height: 100%;
        display: flex;
        align-items: center;
    }

    .con>li {
        text-align: center;
        font-size: 16px;
        width: 80px;
        list-style: none;
    }
    .container ::-webkit-scrollbar {
        display: none;
    }
    </style>
</head>

<body>
    <div class="container">
        <nav class="nav">
            <ul class="con">
                <li>元素一</li>
                <li>元素二</li>
                <li>元素三</li>
                <li>元素四</li>
                <li>元素五</li>
                <li>元素六</li>
                <li>元素七</li>
                <li>元素八</li>
            </ul>
        </nav>
    </div>
</body>

</html>